<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @copyright   Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>

<?php /** @var $this \Magento\DesignEditor\Block\Adminhtml\Theme */?>
<?php
    $themeTitle = $this->escapeQuote($this->getTheme()->getThemeTitle());
?>

<li class="theme" id="theme-id-<?php echo $this->getTheme()->getId() ?>" data-widget-options="<?php echo $this->escapeHtml($this->getOptionsJson()); ?>">
    <div class="theme-content">
        <img class="theme-preview-image" src="<?php echo $this->getTheme()->getThemeImage()->getPreviewImageUrl() ?>" alt="<?php echo $themeTitle ?>"/>
        <?php if (!$this->getTheme()->getAssignedStores()): ?>
            <article class="theme-data">
                <h4 class="theme-title" title="<?php echo $themeTitle ?>"><?php echo $themeTitle ?></h4>
                <div class="actions">
                    <?php echo $this->getButtonsHtml() ?>
                </div>
            </article>
        <?php endif; ?>
    </div>
    <?php if ($this->getTheme()->getAssignedStores()): ?>
        <div class="theme-assigned-data">
            <form action="" method="post" class="edit-theme-title-form">
                <input type="text" value="<?php echo $themeTitle ?>" data-title-original="<?php echo $themeTitle ?>" required autofocus />
                <?php echo $this->getQuickSaveButton()->toHtml() ?>
            </form>
            <h4 class="theme-title" title="<?php echo $themeTitle ?>"><?php echo $themeTitle ?></h4>
            <span class="edit-theme-title"><?php echo __('Edit Theme Name'); ?></span>
            <p class="theme-assigned-to-storeview">
                <span><?php echo __('Assigned to: ')?></span>
                <span><?php echo implode(', ', $this->getStoresTitles()) ?></span>
            </p>
            <div class="actions">
                <?php echo $this->getButtonsHtml() ?>
            </div>
        </div>
    <?php endif; ?>
</li>
